<?php

namespace app\common\model;

class Version extends Base
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    protected $hidden = ['weigh', 'status'];
    protected $append = ['enforce_text'];
    // 定义字段类型
    protected $type = [
    ];

    public function getEnforceTextAttr($value, $data)
    {
        $options = loadEnum('Enforce')->get_options();
        return isset($options[$data['enforce']]) ? $options[$data['enforce']] : '';
    }
}
